import Vue from 'vue'
import Vuex from 'vuex'
import commonModules from '@/common/store'

Vue.use(Vuex)

// const files = require.context('./modules/', true, /\.js$/)
// const appModules = files.keys().reduce((mod, path) => {
//   const name = path.replace(/\.\/(\S+)\.js$/, '$1')
//   mod[name] = files(path).default
//   return mod
// }, {})

export default new Vuex.Store({
  modules: {
    // ...appModules,
    ...commonModules,
  },
  strict: process.env.NODE_ENV !== 'production',
})
